#include<iostream>
#include"show_bytes.h"
using namespace std;

/**
 * Make with least signficant n bits set to 1
 *  Examples: n = 6 --> 0x3F, n = 17 --> 0x1FFFF
 *  Assume 1 <= n <= w
 *
 */
int lower_bits(int x, int n){
    unsigned mask = (1L << n) - 1;
    return x | mask;
}

int main(void){
    int result[] = {lower_bits(0,32),lower_bits(0,16)};
    for(int i = 0; i < 2; ++i){
        byte_pointer pointer = (byte_pointer)&result[i];
        show_bytes(pointer,sizeof(int));
    }

    return 0;
}
